package com.xdq.quartz;

import org.springframework.boot.autoconfigure.quartz.QuartzDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author 徐东强
 * @date 2018/10/23 下午11:29
 **/
@Configuration
public class QuartzDataSourceConfig {

    @Bean
    @ConfigurationProperties(prefix="app.datasource")
    @QuartzDataSource
    public DataSource quartzDataSource() {
        return DataSourceBuilder.create().build();
    }
}
